#include "dialog.h"
#include <QPushButton>
#include <QLabel>
#include <QVBoxLayout>

Dialog::Dialog(QWidget *parent) : QDialog(parent)
{
    QVBoxLayout *layout = new QVBoxLayout();
    this->setLayout(layout);

    QPushButton *button = new QPushButton("并非按钮",this);
    QLabel *label = new QLabel("这不是一个对话框",this);
    layout->addWidget(label);
    layout->addWidget(button);

    connect(button, &QPushButton::clicked,this,&Dialog::handle);
}

void Dialog::handle()
{
    this->close();
}
